
package com.suxiaofang.library.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.suxiaofang.library.controller.dto.UserPasswordDTO;
import com.suxiaofang.library.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

//@Mapper
public interface UserMapper extends BaseMapper<User> {
//
//    @Select("SELECT * FROM sys_user")
//    List<User> findAll();
//
//
//    @Insert("insert into sys_user(username,password,nickname,email,phone) values (#{username}, #{password}, #{nickname}, #{email}, #{phone})")
//    int insert(User user);
//
//    int update(User user);
//
//    @Delete("delete from sys_user where id= #{id}")
//    Integer deleteById(@Param("id") Integer id);
//
//
//    @Select("select * from sys_user where username like concat('%', #{username}, '%') limit #{pageNum},#{pageSize}")
//    List<User> selectPage(Integer pageNum, Integer pageSize, String username);
//
//    @Select("select count(*) from sys_user where username like concat('%', #{username}, '%')")
//    Integer selectPageTotal(String username);



@Update("update sys_user set password = #{newPassword} where username = #{username} and password = #{password}")
int updatePassword(UserPasswordDTO userPasswordDTO);

//    Page<User> findPage(Page<User> page, @Param("username") String username, @Param("email") String email, @Param("address") String address);


}


